home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / game / patch / WHDIGamesA-B.lzh / Arkanoid.lha / Arkanoid Install / Install < prev    next >
Text File  |  1998-07-31  |  3KB  |  169 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")    ;name of readme file
  4. (set #cleanup "")        ;files to delete after install
  5. (set #last-file "last-file")    ;last file the imager should create
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; Checks if given program is reachable via the path
  10. ; if not abort install
  11. ; IN:  #program - to check
  12. ; OUT: -
  13.  
  14. (procedure P_chkrun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  19.   )
  20. )
  21.  
  22. ;****************************
  23.  
  24. (if
  25.   (exists #readme-file)
  26.   (if 
  27.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  28.     ("")
  29.     (run ("SYS:Utilities/More %s" #readme-file))
  30.   )
  31. )
  32.  
  33. (set #program "WHDLoad")
  34. (P_chkrun)
  35.  
  36. (set #program "Patcher")
  37. (P_chkrun)
  38.  
  39. (set @default-dest
  40.   (askdir
  41.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  42.     (help @askdir-help)
  43.     (default @default-dest)
  44.     (disk)
  45.   )
  46. )
  47. (set #dest (tackon @default-dest @app-name))
  48. (if
  49.   (exists #dest)
  50.   (
  51.     (set #choice
  52.       (askbool
  53.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  54.         (default 1)
  55.         (choices "Delete" "Skip")
  56.         (help @askbool-help)
  57.       )
  58.     )
  59.     (if
  60.       (= #choice 1)
  61.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  62.     )
  63.   )
  64. )
  65. (makedir #dest
  66.   (help @makedir-help)
  67.   (infos)
  68. )
  69.  
  70. ;----------------------------
  71.  
  72. (if
  73.   (exists ("%s.newicon" @app-name))
  74.   (set #icon
  75.     (askchoice
  76.       (prompt "\nWhich icon do you like to install ?\n")
  77.       (default 0)
  78.       (choices "Normal" "NewIcon")
  79.       (help @askchoice-help)
  80.     )
  81.   )
  82.   (set #icon 0)
  83. )
  84. (select #icon
  85.   (set #icon ("%s.inf" @app-name))
  86.   (set #icon ("%s.newicon" @app-name))
  87. )
  88. (copyfiles
  89.   (help @copyfiles-help)
  90.   (source #icon)
  91.   (newname ("%s.info" @app-name))
  92.   (dest #dest)
  93. )
  94. (copyfiles
  95.   (help @copyfiles-help)
  96.   (source ("%s.slave" @app-name ))
  97.   (dest #dest)
  98. )
  99. (if
  100.   (exists #readme-file)
  101.   (copyfiles
  102.     (help @copyfiles-help)
  103.     (source #readme-file)
  104.     (dest #dest)
  105.   )
  106. )
  107. (if
  108.   (exists ("%s.info" #readme-file))
  109.   (copyfiles
  110.     (help @copyfiles-help)
  111.     (source ("%s.info" #readme-file))
  112.     (dest #dest)
  113.   )
  114. )
  115.  
  116. ;----------------------------
  117.  
  118. (askdisk
  119.   (dest @app-name)
  120.   (prompt ("\nInsert \"%s\" disk in any drive !" @app-name))
  121.   (help @askdisk-help)
  122. )
  123. (if
  124.   (exists "Arkanoid:Arkanoid.1")
  125.   (
  126.     ;standard files version
  127.     (copyfiles
  128.       (help @copyfiles-help)
  129.       (source "Arkanoid:")
  130.       (dest #dest)
  131.       (pattern "Arkanoid.[123]")
  132.     )
  133.   )
  134.   (
  135.     ;original version nonstandard disk
  136.     (if 
  137.       (= "Arkanoid:" (getassign "DF0" "d"))
  138.       (set #CI_drive "DF0:")
  139.     )
  140.     (if 
  141.       (= "Arkanoid:" (getassign "DF1" "d"))
  142.       (set #CI_drive "DF1:")
  143.     )
  144.     (if 
  145.       (= "Arkanoid:" (getassign "DF2" "d"))
  146.       (set #CI_drive "DF2:")
  147.     )
  148.     (if 
  149.       (= "Arkanoid:" (getassign "DF3" "d"))
  150.       (set #CI_drive "DF3:")
  151.     )
  152.     (run ("Assign \"%sI:\" \"%s\"" @app-name #dest))
  153.     (run ("Patcher -p%s.imager -s%s" @app-name #CI_drive))
  154.     (run ("Assign \"%sI:\" Remove" @app-name))
  155.     (if
  156.       (exists (tackon #dest #last-file))
  157.       ("")
  158.       (abort "Diskimaging not successful !\nThe Patcher was unable to create all needed files !")
  159.     )
  160.   )
  161. )
  162.  
  163. ;----------------------------
  164.  
  165. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  166.  
  167. (exit)
  168.  
  169.